-
Notifications
You must be signed in to change notification settings - Fork 2
Mchp zephyr dspic release v5.0 #4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: dsPIC33A-M5
Are you sure you want to change the base?
Conversation
Highlights: - UART interrupt support - Program memory optimisation - Support for ztest and twister - Context switch refignment - Kernel and thread test cases - Samples support - UART: Echo bot, native tty, passthrough - Blinky - Philosophers - Hello world - Pin control driver - New board support (sdPIC33AK512MPS512) Fixes: - Context switch fixes - System timer fixes - Build fixes Signed-off-by: Muhammed Zamroodh <[email protected]>
Highlights: * Added support for dsPIC33AK512MPS512 * Fixes for kernel and arch test cases * Context switching refignments * Change console to on board USB-UART * Added satck protection Fixes: * Context switch fixes * System timer fixes Signed-off-by: Muhammed Zamroodh <[email protected]>
ret = -EINVAL; | ||
} | ||
|
||
return 0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
shouldnt this return "ret"? this is always returning 0
int ret = 0; | ||
|
||
for (uint8_t i = 0U; i < pin_cnt; i++) { | ||
ret = pinctrl_configure_pin(pins[i]); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
only the last pin result is returned. Should we return on first error or accumulate errors(for debugging purpose)?
key = k_spin_lock(&lock); | ||
/* If receiver buffer is empty, return -1 */ | ||
if ((*UxSTA & BIT_RXBE) != 0U) { | ||
ret_val = -EPERM; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is "-EPERM" is the right error code in this case? Isnt ENODATA or EAGAIN more appropriate here?
*tris &= ~BIT(pin); | ||
} else { | ||
*tris |= BIT(pin); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
shouldn't we also configure Open Drain , Weak Pull up , pull down , IOC , Start High etc?
static int dspic_port_clear_bits_raw(const struct device *dev, gpio_port_pins_t pins) | ||
{ | ||
const struct gpio_dspic_cfg *cfg = dev->config; | ||
volatile uint16_t *lat = (void *)(cfg->base + LAT_OFFSET); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
all functions by default returns 0 , is this expected , do we need to add error handling and return appropriate errors?
(2 * DT_INST_PROP(0, prescalar) * CONFIG_SYS_CLOCK_TICKS_PER_SEC)) | ||
((sys_clock_hw_cycles_per_sec() + \ | ||
((2U * DT_INST_PROP(0, prescalar) * CONFIG_SYS_CLOCK_TICKS_PER_SEC) / 2U)) / \ | ||
(2U * DT_INST_PROP(0, prescalar) * CONFIG_SYS_CLOCK_TICKS_PER_SEC)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
typo->prescaler
|
||
/* Clear the timer interrupt flag status bit*/ | ||
IFS1bits.T1IF = 0; | ||
total_cycles = total_cycles + (uint64_t)PR1; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
interrupt flag clearing is not required?
No description provided.